<script setup lang='ts'>
import { useConfigTableStore } from '@/stores/config/configTableStore'
let store = useConfigTableStore()
let selectedId = 0;
let handleCurrentChange = function(row:any) {
    if (row) {
        selectedId = row.id
    } else {
        selectedId = 0
    }
}
const emit = defineEmits(["confirm"])
let onConfirm = function() {
    emit("confirm", selectedId)
}
</script>
<template>
    <el-dialog>
        <el-table :data="store.tables" border 
            style="width:100%" highlight-current-row
            @current-change="handleCurrentChange">
            <el-table-column label="id" prop="id" width="50"></el-table-column>
            <el-table-column label="名称" prop="name" width="100"></el-table-column>
            <el-table-column label="主键" prop="key" width="100"></el-table-column>
            <el-table-column label="描述" prop="desc"></el-table-column>
        </el-table>
        <el-button @click="onConfirm">确定</el-button>
    </el-dialog>
</template>
<style>
</style>